"""
============================
@auther:多测师-黄sir
@time:2021/9/14:16:51
@email:hw18983616870@163.com
@website:www.duoceshi.cn
============================
"""
import unittest
from utlis.HTMLTestRunner3_New import HTMLTestRunner
from utlis.mail3 import SendMail
def run():
    path = r'D:\workspace\dcs18_api_auto\testcase'
    report_path = r'D:\workspace\dcs18_api_auto\report'
    dicover = unittest.defaultTestLoader.discover(start_dir=path,pattern='Test_*.py')
    filename = report_path+'\\'+'CMS_API_report.html'
    f = open(file=filename,mode='wb')
    runner = HTMLTestRunner(
        stream=f,
        title='CMS平台接口自动化测试报告',
        description='接口测试用例执行情况：',
        tester='dcs_sh18'
    )
    runner.run(dicover)
    f.close()
    # sendmail = SendMail(send_msg=filename,attachment=filename)
    # sendmail.send_mail()
run()